<template>

    <!-- 添加或修改对话框 -->
    <lam-dialog :title="title" :visible.sync="open" width="680px" append-to-body @close="cancel">
      <el-form :ref="formRef" :model="form" :rules="rules" label-width="100px" :disabled="formDisabled">
        <el-row>
          <el-col :span="24">
            <el-form-item label="路径签名" prop="sign">
              <span>{{form.sign}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="文件路径" prop="filePath">
              <span>{{form.filePath}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="文件大小" prop="fileSize">
              <span>{{form.fileSize}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="业务类型" prop="fileSize">
              <span>{{form.busiTypeDictText}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="存储位置" prop="fileSize">
              <span>{{form.locationDictText}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="使用标识" prop="fileSize">
              <span>{{form.useFlagDictText}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="类型" prop="fileType">
              <span>{{form.fileTypeDictText}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="状态" prop="status">
              <span>{{form.statusDictText}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="过期时间" prop="expireTime">
              <span>{{form.expireTime}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="签名KeyMD5" prop="keyMd5">
              <span>{{form.keyMd5}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <span>{{form.remark}}</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <DownloadIframe ref="downloadIframe" />

      <div slot="footer" class="dialog-footer">
        <el-button type="warning" icon="el-icon-download" v-if="form.status==1" v-hasPerms="['sys:file:download']" @click="download">下  载</el-button>
        <el-button @click="cancel">关  闭</el-button>
      </div>
    </lam-dialog>

</template>

<style scoped>
  .el-form-item {
      margin-bottom: 3px;
  }
</style>

<script>
import { EditMixin } from '@/components/mixins/EditMixin';
import DownloadIframe from '@/components/download/DownloadIframe';

export default {
  name: "EditFile",
  mixins:[EditMixin],
  components: {
    DownloadIframe
  },
  data() {
    return {
    };
  },
  created() {
  },
  methods: {
    download(){
      this.$refs.downloadIframe.download({t: this.form.fileType, s: this.form.sign})
    },
  }
};
</script>
